package com.example.picturestorage.schedule;

import com.example.picturestorage.retry.RetryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

//@EnableScheduling
//@EnableRetry
@Configuration
public class MyScheduleTaskTest {

    private int i=0;

    @Autowired
    private RetryService retryService;

    @Scheduled(fixedRate = 60000)
    private void scheduleTask(){
        System.out.println("定时任务 "+i);
        i++;
        retryService.retryTest();
    }
}
